<?php
include("common/header.html");
include("common/left.html");
if(!$_SESSION['memberID']){exit("<script>window.location='dlogin.html'</script>");}
include_once('common/autoload.php');
$s2=SoapInit::GetsoapInside();
$id=intval($_REQUEST["id"]);
$dist=new Dist();
$m_info=$dist->getInfo($id);
if($m_info['dtype']==0 || $m_info['dtype']==1) {
    $name="公司名称";$photo="企业LOGO";
} elseif($m_info['dtype']==5 || $m_info['dtype']==6){
    $name="姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名";
    $photo="我的头像";
} elseif($m_info['dtype']==7){
    $name="集团名称";
    $photo="集团LOGO";
} else{
    $photo="商家标识";
}
//if(!$origin){$origin=array(array());$originisnull=1;}
//$s=new richmodule;
//$s->Fetch_Module_File("tpl/g_info.tpl");
foreach($m_info as $k=>$v){
	if($k=="com_type"){
		$com_type=explode(",",$v);
		foreach($com_type as $c){
			switch($c){
				case "旅行社":$com_type0 = "checked";break;
				case "加盟门店":$com_type1="checked";break;
				case "电商/团购网":$com_type2 = "checked";break;
				case "淘宝/天猫":$com_type3 = "checked";break;
				case "其他":$com_type4 = "checked";break;
			}
		}
	}
//	else{
//		$s->Fetch_String($k,$v);
//	}
}

$pos_list = array('客服部','市场部','财务部','技术部','其他部门');

//$s->Fetch_Array("origin", $origin,0,$originisnull);
//$s->Set_Array_On();
//if($_SESSION['memberID']!=1){
//	$s->Make_If_Module("zzrz", 0);
//}
//else{
//	if(!$m_info['bsn_les']){$s->Make_If_Module("bsn_les", 0);}
//	if(!$m_info['opt_les']){$s->Make_If_Module("opt_les", 0);}
//	if(!$m_info['id_card']){$s->Make_If_Module("id_card", 0);}
//	$money=simplexml_load_string($s2->PFT_Member_Fund($id,0));
//	$s->Fetch_String("money",$money->Rec[0]->UUamoney/100);
//}
//if($m_info['dtype']==6){$s->Make_If_Module("jt", 0);}
//$s->Output_Html();
?>
<link rel="stylesheet" type="text/css" href="css/accountinfro.css"/>
<script type="text/javascript" src="js/updLower.js"></script>
<script type="text/javascript" src="js/ui/CreateTempImg.js"></script>
<div class="accinf_m">
    <iframe name="ifr" style="display:none;" ></iframe>
    <form action="account_info.php" target="ifr" method="post" enctype="multipart/form-data" >
        <input type="hidden" name="id" value="<?=$id?>" />
        <ul>
            <li>
                <b>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</b>
                <span><?=$m_info['account']?></span>
            </li>
            <li>
                <b><?=$name?>：</b>
                <span><input type="text" name="dname" value="<?=$m_info['dname']?>" /></span>
            </li>
            <li>
                <b>联系人姓名：</b>
                <span><input type="text" name="cname" value="<?=$m_info['cname']?>" /></span>
            </li>
            <li>
                <b>所在部门：</b>
                <span>
                    <select name="position">
                    <?php foreach($pos_list as $pos_id=>$pos_name):?>
                        <option value="<?=$pos_id?>" <?=$pos_id==$m_info['position'] ? 'selected':''?>><?=$pos_name?></option>
                    <?php endforeach;?>
                    </select>
                </span>
            </li>
            <li>
                <b>手机号码：</b>
                <span><input type="text" name="mobile" value="<?=$m_info['mobile']?>" /></span>
            </li>
            <li>
                <b>联系QQ：</b>
                <span><input type="text" name="qq" value="<?=$m_info['qq']?>" /></span>
            </li>
            <li>
                <b>联系电话：</b>
                <span><input type="text" name="ctel" value="<?=$m_info['ctel']?>" /></span>
            </li>
            <li>
                <b>联系邮箱：</b>
                <span><input type="text" name="email" value="<?=$m_info['email']?>" /></span>
            </li>
        <?php if($m_info['dtype']!=6):?>
            <li>
                <b>传真号码：</b>
                <span><input type="text" name="fax" value="<?=$m_info['fax']?>" /></span>
            </li>
            <li>
                <b>集团网址：</b>
                <span><input type="text" name="website" value="<?=$m_info['website']?>" /></span>
            </li>
            <li>
                <b>集团简称：</b>
                <span><input type="text" name="short_company_name" value="<?=$m_info['short_company_name']?>" /></span>
            </li>
            <li>
                <b>经营范围：</b>
                <span><input type="text" name="business" value="<?=$m_info['business']?>" /></span>
            </li>
            <li>
                <b>资金余额：</b>
                <span>
                    <?php $money=simplexml_load_string($s2->PFT_Member_Fund($id,0)); ?>
                    <?=$money->Rec[0]->UUamoney/100?>
                </span>
            </li>
            <li>
                <b>集团类型：</b>
            <span style="width:auto;">
                <label class="accept">
                    <input class="accept" type="radio" value="旅行社" <?=$com_type0?> name="com_type[]">
                    旅行社
                </label>
                <label class="accept">
                    <input class="accept" type="radio" value="加盟门店" <?=$com_type1?> name="com_type[]">
                    加盟门店
                </label>
                <label class="accept">
                    <input class="accept" type="radio" value="电商/团购网" <?=$com_type2?> name="com_type[]">
                    电商/团购网
                </label>
                <label class="accept">
                    <input class="accept" type="radio" value="淘宝/天猫" <?=$com_type3?> name="com_type[]">
                    淘宝/天猫
                </label>
                <label class="accept">
                    <input class="accept" type="radio" value="其他" <?=$com_type4?> name="com_type[]">
                    其他
                </label>
            </span>
            </li>
            <!-- <li>
                <b>充值余额：</b>
                <span><input type="text" type="text" name="money" value="" /></span>
            </li> -->
        <?php endif;?>
            <li><input type="submit" class="acc_butn" value="确认修改"/></li>
            <div style="clear:both"></div>
        </ul>
    </form>
</div>
<?php include("common/footer.html");?>
